using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Linq;

namespace BusinessEntities
{
    public class Raider: IComparer<Raider>
    {
        #region Fields

        private string _name;
        private int _level;
        private int _classId;
        private RaiderClass _class;        
        private Talent _primarySpec;
        private Talent _secondarySpec;
        private Activity _activity;
        private int _rankId;
        private Rank _rank;
        private int _avgILevel;
        private DateTime _lastUpdated;
        private int _achvPoints;
        private RaiderRole _role;

        #endregion

        #region Properties

        public RaiderClass Class
        {
            get { return _class; }
            set { _class = value; }
        }
        
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        
        public int Level
        {
            get { return _level; }
            set { _level = value; }
        }

        public int RankId
        {
            get { return _rankId; }
            set { _rankId = value; }
        }

        public int ClassId
        {
            get { return _classId; }
            set { _classId = value; }
        }
            
        public Talent PrimarySpec
        {
            get { return _primarySpec; }
            set { _primarySpec = value; }
        }
        
        public Talent SecondarySpec
        {
            get { return _secondarySpec; }
            set { _secondarySpec = value; }
        }

        public Activity Activity
        {
            get { return _activity; }
            set { _activity = value; }
        }

        public Rank Rank
        {
            get { return _rank; }
            set { _rank = value; }
        }

        public int AverageItemLevel
        {
            get { return _avgILevel; }
            set { _avgILevel = value; }
        }

        public DateTime LastUpdated
        {
            get { return _lastUpdated; }
            set { _lastUpdated = value; }
        }

        public int AchievementPoints
        {
            get { return _achvPoints; }
            set { _achvPoints = value; }
        }

        #endregion

        #region Methods

        public Raider(string name, int level, int classId, string className, Activity activity,int rankId, Rank rank)
        {
            _level = level;
            _classId = classId;            
            _activity = activity;
            _name = name;
            _rankId = rankId;
            _rank = rank;
        }

        public Raider()
        {
            List<String> t = new List<string>();
            
        }

        #endregion

        #region IComparer<Raider> Members

        int IComparer<Raider>.Compare(Raider x, Raider y)
        {
            return x.Class.CompareTo(y.Class);
            //return x.ClassName.CompareTo(y.ClassName);
        }

        public static int CompareByRank(Raider x, Raider y)
        {
            return x.RankId.CompareTo(y.RankId);
        }


        public RaiderRole Role
        {
            get { return _role; }
            set { _role = value; }
        }


        #endregion
    }
}
